<?php
class Cl_UserAttend extends WdkClass 
{
	protected
		/******************************************************/
		//	원본 테이블 정보
		/******************************************************/
		$user_attend_seq			= 0		,	//	출석체크 키값
		$user_attend_date			= ''	,	//	출석 체크 날짜
		$fk_user_seq				= 0		,	//	사용자 키값
		$user_attend_memo			= ''	,	//	메모사항
		$user_attend_insert_time	= 0		;	//	등록시간
		/******************************************************/
		//	추가 정보
		/******************************************************/
	
	/**
	 * 	
	 */
	function __construct()
	{
		parent::__construct();
		self::getDbo();
	}
	
	/**
	 *	
	 */
	public function __init($data)
	{
		parent::__init($data);
		self::dformat();
	}
	
	/**
	 *	
	 */
	public function load($user_attend_seq)
	{
		/*------------------------------------------------------------*/
		$dbo = self::getDbo();
		/*------------------------------------------------------------*/
		self::__init($dbo->cLoad($user_attend_seq));
	}
	
	/**
	 *	
	 */
	public function dformat()
	{
	
	}
	
	/**
	 *	
	 */
	public function insert($log='Insert')
	{
		/*------------------------------------------------------------*/
		$dbo = self::getDbo();
		/*------------------------------------------------------------*/
		$this->user_attend_date			= date('Y-m-d');
		$this->user_attend_insert_time	= time();
		
		$data = array(	'user_attend_date'			=>	$this->user_attend_date,
						'fk_user_seq'				=>	$this->fk_user_seq,
						'user_attend_memo'			=>	$this->user_attend_memo,
						'user_attend_insert_time'	=>	$this->user_attend_insert_time
					);
		$this->user_attend_seq = $dbo->insert($data);
		$this->backup($log);
	}
	
	/**
	 * 
	 */
	public function update($log='update')
	{
		throw new MethodNotImplementedException();
	}
	
	/**
	 * 
	 */
	public function delete($log='delete')
	{
		throw new MethodNotImplementedException();
	}
	
	/**
	 *	
	 */
	private function backup($log='')
	{
// 		/*------------------------------------------------------------*/
// 		$dbo = self::getDbo();
// 		/*------------------------------------------------------------*/
// 		$dbo->log($this->user_seq, $log, $this->backup_data);
	}
	
	/**
	 * 
	 */
	public function getDbo()
	{
		return Wdk::model(substr(__CLASS__, 3));
	}
}